home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / PInterfaces / ENET.p < prev    next >
Encoding:
Text File  |  1994-11-11  |  3.7 KB  |  131 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ENET.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT ENET;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __ENET__}
  27. {$SETC __ENET__ := 1}
  28.  
  29. {$I+}
  30. {$SETC ENETIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {    ConditionalMacros.p                                            }
  38.  
  39. {$IFC UNDEFINED __OSUTILS__}
  40. {$I OSUtils.p}
  41. {$ENDC}
  42. {    MixedMode.p                                                    }
  43. {    Memory.p                                                    }
  44.  
  45. {$PUSH}
  46. {$ALIGN MAC68K}
  47. {$LibExport+}
  48.  
  49. CONST
  50.     ENetSetGeneral                = 253;                            {Set "general" mode}
  51.     ENetGetInfo                    = 252;                            {Get info}
  52.     ENetRdCancel                = 251;                            {Cancel read}
  53.     ENetRead                    = 250;                            {Read}
  54.     ENetWrite                    = 249;                            {Write}
  55.     ENetDetachPH                = 248;                            {Detach protocol handler}
  56.     ENetAttachPH                = 247;                            {Attach protocol handler}
  57.     ENetAddMulti                = 246;                            {Add a multicast address}
  58.     ENetDelMulti                = 245;                            {Delete a multicast address}
  59.     EAddrRType                    = 'eadr';
  60.  
  61.     
  62. TYPE
  63.     EParamBlkPtr = ^EParamBlock;
  64.  
  65.     {
  66.         ENETCompletionProcPtr uses register based parameters on the 68k and cannot
  67.         be written in or called from a high-level language without the help of
  68.         mixed mode or assembly glue.
  69.  
  70.         In:
  71.          => thePBPtr        A0.L
  72.     }
  73.     ENETCompletionProcPtr = ProcPtr;  { PROCEDURE ENETCompletion(thePBPtr: EParamBlkPtr); }
  74.     ENETCompletionUPP = UniversalProcPtr;
  75.  
  76.     EParamBlock = PACKED RECORD
  77.         qLink:                    ^QElem;                                    {General EParams}
  78.         qType:                    INTEGER;                                {queue type}
  79.         ioTrap:                    INTEGER;                                {routine trap}
  80.         ioCmdAddr:                Ptr;                                    {routine address}
  81.         ioCompletion:            ENETCompletionUPP;                        {completion routine}
  82.         ioResult:                OSErr;                                    {result code}
  83.         ioNamePtr:                StringPtr;                                {->filename}
  84.         ioVRefNum:                INTEGER;                                {volume reference or drive number}
  85.         ioRefNum:                INTEGER;                                {driver reference number}
  86.         csCode:                    INTEGER;                                {Call command code}
  87.         CASE INTEGER OF
  88.         0: (
  89.             eProtType:                    INTEGER;                            {Ethernet protocol type}
  90.             ePointer:                    Ptr;                                {No support for PowerPC code}
  91.             eBuffSize:                    INTEGER;                            {buffer size}
  92.             eDataSize:                    INTEGER;                            {number of bytes read}
  93.            );
  94.         1: (
  95.             eMultiAddr:                    ARRAY [0..5] OF CHAR;                {Multicast Address}
  96.            );
  97.     END;
  98. CONST
  99.     uppENETCompletionProcInfo = $00009802; { Register PROCEDURE (4 bytes in A0); }
  100.  
  101. PROCEDURE CallENETCompletionProc(thePBPtr: EParamBlkPtr; userRoutine: ENETCompletionUPP);
  102.     {$IFC NOT GENERATINGCFM}
  103.     {To be implemented:  Glue to move parameters into registers.}
  104.     {$ENDC}
  105.  
  106. FUNCTION NewENETCompletionProc(userRoutine: ENETCompletionProcPtr): ENETCompletionUPP;
  107.     {$IFC NOT GENERATINGCFM }
  108.     INLINE $2E9F;
  109.     {$ENDC}
  110.  
  111. FUNCTION EWrite(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  112. FUNCTION EAttachPH(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  113. FUNCTION EDetachPH(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  114. FUNCTION ERead(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  115. FUNCTION ERdCancel(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  116. FUNCTION EGetInfo(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  117. FUNCTION ESetGeneral(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  118. FUNCTION EAddMulti(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  119. FUNCTION EDelMulti(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  120.  
  121. {$ALIGN RESET}
  122. {$POP}
  123.  
  124. {$SETC UsingIncludes := ENETIncludes}
  125.  
  126. {$ENDC} {__ENET__}
  127.  
  128. {$IFC NOT UsingIncludes}
  129.  END.
  130. {$ENDC}
  131.